import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { NgZorroAntdModule, NzIconModule, NZ_ICONS, NZ_I18N, zh_CN } from 'ng-zorro-antd';
/** 配置 angular i18n **/
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
registerLocaleData(zh);
import { IconDefinition } from '@ant-design/icons-angular';
//引入icon
import * as AllIcons from '@ant-design/icons-angular/icons';
const antDesignIcons = AllIcons as {
  [key: string]: IconDefinition;
};
const icons: IconDefinition[] = Object.keys(antDesignIcons).map(key => antDesignIcons[key])
import { AppRoutingModule } from './app-routing.module';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
import { AuditModalComponent } from './components/audit-modal/audit-modal.component';
import { AuditCenterComponent } from './router/audit-center/audit-center.component';
import { TableConstructorComponent } from './router/table-constructor/table-constructor.component';
import { AuditCenterPipePipe } from './pipe/audit-center-pipe.pipe';
import { ModalTreeComponent } from './components/modal-tree/modal-tree.component';
import { ScriptInitComponent } from './router/script-init/script-init.component';

@NgModule({
  declarations: [
    AppComponent,
    AuditModalComponent,
    AuditCenterComponent,
    TableConstructorComponent,
    AuditCenterPipePipe,
    ModalTreeComponent,
    ScriptInitComponent,
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    NgZorroAntdModule,
    HttpClientModule,
    NzIconModule,
    ReactiveFormsModule //引入ReactiveFormsModule
  ],
  providers: [
    { provide: NZ_I18N, useValue: zh_CN },
    { provide: NZ_ICONS, useValue: icons }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
